#include "full_multigrid.h"

int main()
{
    ///一维possion方程
    // int pow_n = 15;
    // int dim1_n_layer = pow_n -1;
    // auto DIM1_u = [](double x) -> double { return -x*x/2;};
    // auto DIM1_f = [](double x) -> double { return 1;};
    // double DIM1_x_l = 0.0;
    // double DIM1_x_r = 1.0;
    // Multigarid_Solution_Dim1(DIM1_x_l, DIM1_x_r, pow_n, dim1_n_layer, DIM1_f, DIM1_u);

    ///二维possion方程
    vector<double> DIM2_lb = { -1, -1};
    vector<double> DIM2_rt = {1, 1};
    int nx_pow = 8;
    int ny_pow = 8;
    int dim2_n_layer = nx_pow -1;
    int acc = 4 ;
    auto DIM2_u = [](double x, double y) -> double{ return -(x*x + y*y)/4;};
    auto DIM2_f = [](double x, double y) -> double{ return 1; };
    Multigarid_Solution_Dim2(DIM2_lb, DIM2_rt, nx_pow, ny_pow, dim2_n_layer, DIM2_f, DIM2_u, acc);


    return 0 ;
}